import {Injectable} from '@angular/core';
import {environment} from "../../../../../environments/environment";
import {HttpUtilService} from "../../../../services/http/http-util.service";
import {Observable} from "rxjs";

@Injectable({
  providedIn: 'root'
})
export class TeamUserService {

  private prefix = environment.serverName.system + "/team-user/"

  constructor(private http: HttpUtilService) {
  }

  add(teamId: string, userId: string, handleError = true): Observable<void> {
    return this.http.post(this.prefix + "add", {teamId, userId}, handleError)
  }


  delete(teamId: string, userId: string, handleError = true): Observable<void> {
    return this.http.post(this.prefix + "delete", {teamId, userId}, handleError)
  }
}
